package day06_homework_4;

import java.util.Scanner;

public class RectangleTest {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		while(true){
			System.out.println("请选择参数形式：");
			System.out.println("1.默认");
			System.out.println("2.长宽一致");
			System.out.println("3.长宽不一致");
			int choose = input.nextInt();
			switch (choose) {
			case 1:
				Rectangle rectangle = new Rectangle();
				System.out.println("面积是："+rectangle.calculateArea());
				System.out.println("周长是："+rectangle.calculatePerimeter());
				break;
			case 2:
				System.out.println("请输入数值：");
				int all = input.nextInt();
				Rectangle rectangle1 = new Rectangle(all);
				System.out.println("面积是："+rectangle1.calculateArea());
				System.out.println("周长是："+rectangle1.calculatePerimeter());
				break;
			case 3:
				System.out.println("请输入长度：");
				int len = input.nextInt();
				System.out.println("请输入宽度：");
				int wid = input.nextInt();
				Rectangle rectangle2 = new Rectangle(len,wid);
				System.out.println("面积是："+rectangle2.calculateArea());
				System.out.println("周长是："+rectangle2.calculatePerimeter());
				break;

			default:
				break;
			}
		}
	}
}
